import { request } from "@/utils/service"
import { getToken } from "@/utils/cache/cookies"
import axios from "axios"
const baseURL = import.meta.env.VITE_BASE_API

/** 查 线下汇总 */
export function getSZxxhzApi(params: any) {
  return request({
    url: "/sz/yy/OffLine/selectOffLineCount",
    method: "get",
    params
  })
}
/** 查  明细如下*/
export function getSZmmrxApi(params: any) {
  return request({
    url: "/sz/yy/OffLine/selectOffLine",
    method: "get",
    params
  })
}
// 根据token查部门下的团队
export function getqueryTeamName() {
  return request({
    url: "/sz/getShop",
    method: "get"
  })
}
// 改
export function upSZmmrxApi(data: any) {
  return request({
    url: "/sz/yy/OffLine/insertOffLineReviewOne",
    method: "post",
    data
  })
}
// 批量修改提交
export function updateSZmmrxApiIDS(data: any) {
  return request({
    url: "/sz/yy/OffLine/insertOffLineReview",
    method: "post",
    data
  })
}
// 批量修改提交 删除
export function delDeSZmmrxApiIDS(data: any) {
  return request({
    url: "/sz/yy/OffLine/deleteOffLineReviewList",
    method: "post",
    data
  })
}

// 删除
export function delDeSZmmrxApi(ids: any) {
  return request({
    url: "/sz/yy/OffLine/deleteOffLineReview?",
    method: "delete",
    params: {
      ids
    }
  })
}

// 导出
export function downLoadTable(data: any) {
  return axios({
    url: `${baseURL}/sz/yy/OffLine/OffLineExport`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data,
    responseType: "blob"
  })
}
